package com.lxw.manage.course.service;

import com.lxw.framework.domain.course.Category;

import com.lxw.framework.domain.course.ext.CategoryNode;
import com.lxw.manage.course.dao.CategoryMapper;
import com.lxw.manage.course.dao.CategoryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements ICategoryService {

    @Autowired
    CategoryRepository categoryRepository;
    @Autowired
    CategoryMapper categoryMapper;

    @Override
    public List<Category> findAll() {
        List<Category> all = categoryRepository.findAll();

        return all;
    }

    @Override
    public CategoryNode findCategoryList() {
        //查询级联
        CategoryNode categoryNode = categoryMapper.findCategoryList();

        return categoryNode;
    }
}
